﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DialogManager : MonoBehaviour
{
    [SerializeField] private Text nameField;
    [SerializeField] private Text dialogField;

    [SerializeField] private Button continueButton;

    public int dialogIndex;

    private DialogText sheet;
    // Start is called before the first frame update
    void Start()
    {
        sheet = this.gameObject.GetComponent<DialogText>();
        dialogIndex = 0;
    }

    // Update is called once per frame
    void Update()
    {
    }

    public void loadText(int index)
    {
        nameField.text = sheet.dialog[index,0];
        dialogField.text = sheet.dialog[index,1];
        
    }

    public void ButtonContinue()
    {
        dialogIndex++;
    }
}
